package com.dinglian.ots.dao.mapper;

import com.dinglian.ots.dao.model.Brand;
import com.dinglian.ots.dao.model.BrandExample;
import com.dinglian.ots.dao.model.BrandWithBLOBs;
import java.util.List;
import java.util.Map;

import com.dinglian.ots.vo.brand.BrandRankVo;
import com.dinglian.ots.vo.brand.BrandTopVo;
import com.dinglian.ots.vo.brand.BrandVo;
import com.dinglian.ots.vo.brand.TopBrandVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

public interface BrandMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int countByExample(BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int deleteByExample(BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int insert(BrandWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int insertSelective(BrandWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    List<BrandWithBLOBs> selectByExampleWithBLOBsWithRowbounds(BrandExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    List<BrandWithBLOBs> selectByExampleWithBLOBs(BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    List<Brand> selectByExampleWithRowbounds(BrandExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    List<Brand> selectByExample(BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    BrandWithBLOBs selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") BrandWithBLOBs record, @Param("example") BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByExampleWithBLOBs(@Param("record") BrandWithBLOBs record, @Param("example") BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") Brand record, @Param("example") BrandExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(BrandWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByPrimaryKeyWithBLOBs(BrandWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_brand
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(Brand record);
    /**
     * 获取品牌列表
     * @param userId
     * @param categoryId
     * @param keyword
     * @return
     */
    List<BrandVo> getBrandList(@Param("userId")Integer userId, @Param("categoryId") Integer categoryId, @Param("keyword")String keyword);

    /**
     * 获取推荐品牌列表
     * @param categoryId
     * @return
     */
    List<BrandVo> getRecommendBrand(@Param("categoryId")Integer categoryId);

    /**
     * 获取排行榜
     * @return
     */
    List<TopBrandVo> getTopBillboard(@Param("categoryId")Integer categoryId);

    /**
     * 查询品牌详情
     * @param userId
     * @param brandId
     * @return
     */
    Map getBrandDetail(@Param("userId") Integer userId, @Param("brandId") Integer brandId);

    /**
     * 获取子品牌
     * @param brandId
     * @return
     */
    List<Map> getChildBrand(@Param("brandId") Integer brandId);

    /**
     * 分页获取品牌排行
     * @param name
     * @param phone
     * @param startTime
     * @param endTime
     * @return
     */
    List<BrandRankVo> getBrandRankList(@Param("name") String name, @Param("phone") String phone, @Param("isRecommend")Integer isRecommend, @Param("startTime") String startTime, @Param("endTime") String endTime);


    /**
     * 查询各品牌的起订量
     * @param productIdList
     * @return
     */
    List<Map> selectMiniQty(@Param("productIdList") List<Integer> productIdList);

    /**
     * 获取TOP品牌排行
     * @param name
     * @param phone
     * @param isRecommend
     * @param startTime
     * @param endTime
     * @return
     */
    List<BrandRankVo> getTopBrandRankList(@Param("name") String name, @Param("phone") String phone,@Param("isRecommend")Integer isRecommend, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 推荐top品牌
     * @param categoryId
     * @return
     */
    List<BrandTopVo> getRecommendTopBrand(@Param("categoryId") Integer categoryId);
}